from django.contrib import admin

from MyBlog.my_admin_site import my_site
from app.admin import MyBaseAdmin
from playingPlanet.models import Moments, JudgeForMoment


@admin.register(Moments,site=my_site)
class MomentsAdmin(admin.ModelAdmin,MyBaseAdmin):
    list_display = ['id','userId','content','ispublic','date']
    list_display_links = list_display[:1]  # 默认的链接是id
    search_fields = list_display  # 搜索的字段同list_display
    list_filter = list_display[1:3]  # 过滤字段为前3个字段


@admin.register(JudgeForMoment,site=my_site)
class JudgeForMomentAdmin(admin.ModelAdmin,MyBaseAdmin):
    list_display = ['id','judger','moment','content','date']
    list_display_links = list_display[:1]  # 默认的链接是id
    search_fields = list_display  # 搜索的字段同list_display
    list_filter = list_display[1:3]  # 过滤字段为前3个字段
